package com.corejava.training.collections.car.pre15;

public class CellphoneMutable {

	// instance variables (/fields)
	private String company;
	private String model;
	private String description;
	private String operatingSystem;
	private double price;
	
	// getters setters
	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getOperatingSystem() {
		return operatingSystem;
	}

	public void setOperatingSystem(String operatingSystem) {
		this.operatingSystem = operatingSystem;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}
	
@Override
public boolean equals(Object obj) {

	if (obj instanceof CellphoneMutable) {

		CellphoneMutable objLaptop = (CellphoneMutable) obj;

		return objLaptop.getCompany().equals(this.getCompany());

	} else if (obj instanceof CellphoneMutable) {

		CellphoneMutable objLaptop = (CellphoneMutable) obj;

		return objLaptop.getModel().equals(this.getModel());

	} else {

		return false;

	}

}

@Override
public int hashCode() {

	return this.company.hashCode();

}
	
	
	

} // end of class
